//
//  BHMyAttensionUserCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/22.
//

import UIKit

class BHMyAttensionUserCell: UITableViewCell {

    @IBOutlet weak var iconImgView: UIImageView!
    
    @IBOutlet weak var name_label: UILabel!
    
    @IBOutlet weak var attentionBtn: UIButton!
    
    var model: BHUserListModel!{
        didSet {
            self.iconImgView.sd_setImage(with: URL.init(string: model.userAvatar), completed: nil)
            if model.type == 2 {
                self.name_label.text = model.signName
            }else {
                self.name_label.text = model.userName
            }
            if model.userId == BHMeUserInfoModel.shared.userId {
                self.attentionBtn.isHidden = true
            }else {
                self.attentionBtn.isHidden = false
                self.attentionBtn.isSelected = model.attentionFalg == 1
            }
        }
    }
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.attentionBtn.addLayerCorner(12, 0.5, .color_34CE98)
        self.iconImgView.addLayerCorner(16, 0, .white)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
